/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.att.config;

import java.awt.EventQueue;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.JFileChooser;
import javax.swing.JMenuItem;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.android.ddmlib.AdbCommandRejectedException;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.ShellCommandUnresponsiveException;
import com.android.ddmlib.TimeoutException;
import com.greenpineyu.fel.FelEngine;
import com.greenpineyu.fel.FelEngineImpl;

/**
 *
 * @author lenovo
 */
public class MainFrame extends javax.swing.JFrame{
    
    private Thread cmdTask;

    /**
     * Creates new form MainFrame
     */
    public MainFrame() {
        initComponents();
    }

    private void stopRunningCmdTask() {
        if (cmdTask != null && cmdTask.isAlive()) {
            System.out.println(cmdTask.getId());
            cmdTask.stop();
            jtaOutput.setText("");
        } 
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPopupMenu1 = new javax.swing.JPopupMenu();
        jSplitPane1 = new javax.swing.JSplitPane();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jtfXExpress = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jtfYExpress = new javax.swing.JTextField();
        jPanel6 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jbtnGetEventAll = new javax.swing.JButton();
        jbtnFindAllInputDevice = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jtfEventX = new javax.swing.JTextField();
        jbtnGetEventX = new javax.swing.JButton();
        jbtnStopCommand = new javax.swing.JButton();
        jbtnExportConfig = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtaTouch = new javax.swing.JTextArea();
        jbtnTouchExecute = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jtfTouchX = new javax.swing.JTextField();
        jtfTouchY = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jtaDragStart = new javax.swing.JTextArea();
        jPanel13 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jtaDragProcedure = new javax.swing.JTextArea();
        jPanel14 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jtaDragEnd = new javax.swing.JTextArea();
        jLabel3 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jtfDragStartX = new javax.swing.JTextField();
        jtfDragStartY = new javax.swing.JTextField();
        jbtnDragExecute = new javax.swing.JButton();
        jtfDragEndX = new javax.swing.JTextField();
        jtfDragY = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jtfDragSteps = new javax.swing.JTextField();
        jPanel7 = new javax.swing.JPanel();
        jPanel15 = new javax.swing.JPanel();
        jScrollPane10 = new javax.swing.JScrollPane();
        jtaLongpressStart = new javax.swing.JTextArea();
        jPanel16 = new javax.swing.JPanel();
        jScrollPane11 = new javax.swing.JScrollPane();
        jtaLongpressEnd = new javax.swing.JTextArea();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jtfLongpressX = new javax.swing.JTextField();
        jtfLongpressY = new javax.swing.JTextField();
        jbtnLongpressExecute = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jtaHome = new javax.swing.JTextArea();
        jbtnHomeExecute = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jtaBack = new javax.swing.JTextArea();
        jbtnBackExecute = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jtaMenu = new javax.swing.JTextArea();
        jbtnMenuExecute = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jtaSearch = new javax.swing.JTextArea();
        jbtnSearchExecute = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jtaOutput = new javax.swing.JTextArea();

        jPopupMenu1.setInvoker(jtaOutput);
        jPopupMenu1.setPreferredSize(new java.awt.Dimension(100, 50));

        JMenuItem item1 = new JMenuItem("清除");

        JMenuItem item2 = new JMenuItem("复制");

        jPopupMenu1.add(item1);
        jPopupMenu1.add(item2);

        item1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clearTextActionPerformed(evt);
            }
        });

        item2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                copyText(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jSplitPane1.setDividerLocation(300);
        jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        jSplitPane1.setOneTouchExpandable(true);

        jTabbedPane1.setPreferredSize(new java.awt.Dimension(800, 300));

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("参数"));

        jLabel4.setText("x=");

        jtfXExpress.setText("x * 2.05 + 21");

        jLabel5.setText("y=");

        jtfYExpress.setText("y * 1.1");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(37, 37, 37)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jtfXExpress, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
                    .addComponent(jtfYExpress, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jtfXExpress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jtfYExpress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("命令"));

        jLabel6.setText("getevent");

        jLabel7.setText("cat /proc/bus/input/devices");

        jbtnGetEventAll.setText("执行");
        jbtnGetEventAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnGetEventAllActionPerformed(evt);
            }
        });

        jbtnFindAllInputDevice.setText("执行");
        jbtnFindAllInputDevice.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnFindAllInputDeviceActionPerformed(evt);
            }
        });

        jLabel8.setText("getevent  /dev/input/eventX");

        jtfEventX.setText("0");

        jbtnGetEventX.setText("执行");
        jbtnGetEventX.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnGetEventXActionPerformed(evt);
            }
        });

        jbtnStopCommand.setText("停止命令");
        jbtnStopCommand.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnStopCommandActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7)
                    .addComponent(jLabel6)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jbtnStopCommand)
                            .addComponent(jLabel8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEventX, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jbtnGetEventX, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbtnFindAllInputDevice, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbtnGetEventAll, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(16, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jbtnGetEventAll))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jbtnFindAllInputDevice)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jtfEventX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtnGetEventX))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 74, Short.MAX_VALUE)
                .addComponent(jbtnStopCommand)
                .addContainerGap())
        );

        jbtnExportConfig.setText("导出配置");
        jbtnExportConfig.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnExportConfigActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbtnExportConfig)
                .addGap(0, 213, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jbtnExportConfig)
                .addContainerGap())
        );

        jTabbedPane1.addTab("设置", jPanel1);

        jtaTouch.setColumns(20);
        jtaTouch.setRows(5);
        jtaTouch.setText("sendevent dev/input/event1 3 24 56\nsendevent dev/input/event1 1 330 1\nsendevent dev/input/event1 3 48 1\nsendevent dev/input/event1 3 53 x\nsendevent dev/input/event1 3 54 y\nsendevent dev/input/event1 3 57 0\nsendevent dev/input/event1 0 2 0\nsendevent dev/input/event1 0 0 0\nsendevent dev/input/event1 3 24 52\nsendevent dev/input/event1 3 48 1\nsendevent dev/input/event1 3 53 x\nsendevent dev/input/event1 3 54 y\nsendevent dev/input/event1 3 57 0\nsendevent dev/input/event1 0 2 0\nsendevent dev/input/event1 0 0 0\nsendevent dev/input/event1 3 24 0\nsendevent dev/input/event1 1 330 0\nsendevent dev/input/event1 3 48 0\nsendevent dev/input/event1 3 53 x\nsendevent dev/input/event1 3 54 y\nsendevent dev/input/event1 3 57 0\nsendevent dev/input/event1 0 2 0\nsendevent dev/input/event1 0 0 0");
        jScrollPane1.setViewportView(jtaTouch);

        jbtnTouchExecute.setText("执行");
        jbtnTouchExecute.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnTouchExecuteActionPerformed(evt);
            }
        });

        jLabel2.setText("x = ");

        jLabel9.setText("y = ");

        jtfTouchX.setText("48");

        jtfTouchY.setText("691");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 672, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jbtnTouchExecute, javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addComponent(jLabel2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jtfTouchX, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfTouchY, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(47, 47, 47))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jtfTouchX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jtfTouchY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jbtnTouchExecute)
                .addContainerGap(132, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("touch", jPanel2);

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder("start"));
        jPanel12.setPreferredSize(new java.awt.Dimension(200, 270));

        jtaDragStart.setColumns(20);
        jtaDragStart.setRows(5);
        jtaDragStart.setText("sendevent dev/input/event0 3 58 45\nsendevent dev/input/event0 3 48 4\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 1\nsendevent dev/input/event0 3 53 startx\nsendevent dev/input/event0 3 54 starty\nsendevent dev/input/event0 3 57 0\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 438\nsendevent dev/input/event0 3 54 833\nsendevent dev/input/event0 3 57 1\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 41\nsendevent dev/input/event0 3 54 537\nsendevent dev/input/event0 3 57 2\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 1 330 1\nsendevent dev/input/event0 0 0 0");
        jScrollPane3.setViewportView(jtaDragStart);

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3)
        );

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder("procedure"));
        jPanel13.setPreferredSize(new java.awt.Dimension(200, 24));

        jtaDragProcedure.setColumns(20);
        jtaDragProcedure.setRows(5);
        jtaDragProcedure.setText("sendevent dev/input/event0 3 58 50\nsendevent dev/input/event0 3 48 5\nsendevent dev/input/event0 3 49 1\nsendevent dev/input/event0 3 52 1\nsendevent dev/input/event0 3 53 x\nsendevent dev/input/event0 3 54 y\nsendevent dev/input/event0 3 57 0\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 438\nsendevent dev/input/event0 3 54 833\nsendevent dev/input/event0 3 57 1\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 41\nsendevent dev/input/event0 3 54 537\nsendevent dev/input/event0 3 57 2\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 1\nsendevent dev/input/event0 3 54 0\nsendevent dev/input/event0 3 57 3\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 1\nsendevent dev/input/event0 3 54 0\nsendevent dev/input/event0 3 57 4\nsendevent dev/input/event0 0 2 0\nsendevent dev/input/event0 0 0 0");
        jScrollPane4.setViewportView(jtaDragProcedure);

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4)
        );

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder("end"));
        jPanel14.setPreferredSize(new java.awt.Dimension(200, 0));

        jtaDragEnd.setColumns(20);
        jtaDragEnd.setRows(5);
        jtaDragEnd.setText("sendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 endx\nsendevent dev/input/event0 3 54 endy\nsendevent dev/input/event0 3 57 0\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 438\nsendevent dev/input/event0 3 54 833\nsendevent dev/input/event0 3 57 1\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 3 58 0\nsendevent dev/input/event0 3 48 0\nsendevent dev/input/event0 3 49 0\nsendevent dev/input/event0 3 52 0\nsendevent dev/input/event0 3 53 41\nsendevent dev/input/event0 3 54 537\nsendevent dev/input/event0 3 57 2\nsendevent dev/input/event0 0 2 0\n@\nsendevent dev/input/event0 1 330 0\nsendevent dev/input/event0 0 0 0");
        jScrollPane5.setViewportView(jtaDragEnd);

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane5)
        );

        jLabel3.setText("startx");

        jLabel10.setText("starty");

        jLabel11.setText("endx");

        jLabel12.setText("endy");

        jtfDragStartX.setText("100");

        jtfDragStartY.setText("10");

        jbtnDragExecute.setText("执行");
        jbtnDragExecute.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnDragExecuteActionPerformed(evt);
            }
        });

        jtfDragEndX.setText("100");

        jtfDragY.setText("400");

        jLabel13.setText("step");

        jtfDragSteps.setText("5");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(0, 53, Short.MAX_VALUE)
                        .addComponent(jbtnDragExecute))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10)
                            .addComponent(jLabel12)
                            .addComponent(jLabel3)
                            .addComponent(jLabel11)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jtfDragSteps)
                            .addComponent(jtfDragStartX)
                            .addComponent(jtfDragStartY)
                            .addComponent(jtfDragEndX)
                            .addComponent(jtfDragY))))
                .addGap(49, 49, 49))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
            .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
            .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jtfDragStartX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jtfDragStartY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jtfDragEndX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jtfDragY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jtfDragSteps, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(17, 17, 17)
                .addComponent(jbtnDragExecute)
                .addContainerGap(40, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("drag", jPanel3);

        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder("start"));

        jtaLongpressStart.setColumns(20);
        jtaLongpressStart.setRows(5);
        jtaLongpressStart.setText("sendevent dev/input/event1 3 24 48\nsendevent dev/input/event1 1 330 1\nsendevent dev/input/event1 3 48 1\nsendevent dev/input/event1 3 53 x\nsendevent dev/input/event1 3 54 y\nsendevent dev/input/event1 3 57 0\nsendevent dev/input/event1 0 2 0\nsendevent dev/input/event1 0 0 0");
        jScrollPane10.setViewportView(jtaLongpressStart);

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE)
        );

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder("end"));

        jtaLongpressEnd.setColumns(20);
        jtaLongpressEnd.setRows(5);
        jtaLongpressEnd.setText("sendevent dev/input/event1 3 24 0\nsendevent dev/input/event1 1 330 0\nsendevent dev/input/event1 3 48 0\nsendevent dev/input/event1 3 53 x\nsendevent dev/input/event1 3 54 y\nsendevent dev/input/event1 3 57 0\nsendevent dev/input/event1 0 2 0\nsendevent dev/input/event1 0 0 0");
        jScrollPane11.setViewportView(jtaLongpressEnd);

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 302, Short.MAX_VALUE)
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE)
        );

        jLabel14.setText("x=");

        jLabel15.setText("y=");

        jbtnLongpressExecute.setText("执行");
        jbtnLongpressExecute.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnLongpressExecuteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel7Layout.createSequentialGroup()
                            .addComponent(jLabel14)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jtfLongpressX, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel7Layout.createSequentialGroup()
                            .addComponent(jLabel15)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jtfLongpressY)))
                    .addComponent(jbtnLongpressExecute))
                .addGap(106, 106, 106))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jtfLongpressX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(24, 24, 24)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jtfLongpressY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jbtnLongpressExecute)
                .addContainerGap(126, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("longpress", jPanel7);

        jtaHome.setColumns(20);
        jtaHome.setRows(5);
        jtaHome.setText("sendevent dev/input/event3 3 48 15\nsendevent dev/input/event3 3 50 1\nsendevent dev/input/event3 3 53 384\nsendevent dev/input/event3 3 54 1004\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\nsendevent dev/input/event3 3 48 0\nsendevent dev/input/event3 3 50 1\nsendevent dev/input/event3 3 53 384\nsendevent dev/input/event3 3 54 1004\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\n");
        jScrollPane6.setViewportView(jtaHome);

        jbtnHomeExecute.setText("执行");
        jbtnHomeExecute.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnHomeExecuteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 684, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtnHomeExecute)
                .addGap(98, 98, 98))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(jbtnHomeExecute)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("home", jPanel8);

        jtaBack.setColumns(20);
        jtaBack.setRows(5);
        jtaBack.setText("sendevent dev/input/event3 3 48 33\nsendevent dev/input/event3 3 50 3\nsendevent dev/input/event3 3 53 662\nsendevent dev/input/event3 3 54 1000\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\nsendevent dev/input/event3 3 48 0\nsendevent dev/input/event3 3 50 3\nsendevent dev/input/event3 3 53 662\nsendevent dev/input/event3 3 54 1000\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\n");
        jScrollPane7.setViewportView(jtaBack);

        jbtnBackExecute.setText("执行");
        jbtnBackExecute.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnBackExecuteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 684, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtnBackExecute)
                .addGap(98, 98, 98))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jbtnBackExecute)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("back", jPanel9);

        jtaMenu.setColumns(20);
        jtaMenu.setRows(5);
        jtaMenu.setText("sendevent dev/input/event3 3 48 46\nsendevent dev/input/event3 3 50 4\nsendevent dev/input/event3 3 53 101\nsendevent dev/input/event3 3 54 977\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\nsendevent dev/input/event3 3 48 25\nsendevent dev/input/event3 3 50 2\nsendevent dev/input/event3 3 53 101\nsendevent dev/input/event3 3 54 977\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\nsendevent dev/input/event3 3 48 0\nsendevent dev/input/event3 3 50 2\nsendevent dev/input/event3 3 53 101\nsendevent dev/input/event3 3 54 977\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\n");
        jScrollPane8.setViewportView(jtaMenu);

        jbtnMenuExecute.setText("执行");
        jbtnMenuExecute.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnMenuExecuteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 684, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtnMenuExecute)
                .addGap(98, 98, 98))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jbtnMenuExecute)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("menu", jPanel10);

        jtaSearch.setColumns(20);
        jtaSearch.setRows(5);
        jtaSearch.setText("sendevent dev/input/event3 3 48 18\nsendevent dev/input/event3 3 50 1\nsendevent dev/input/event3 3 53 990\nsendevent dev/input/event3 3 54 997\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\nsendevent dev/input/event3 3 48 0\nsendevent dev/input/event3 3 50 1\nsendevent dev/input/event3 3 53 990\nsendevent dev/input/event3 3 54 997\nsendevent dev/input/event3 0 2 0\nsendevent dev/input/event3 0 0 0\n");
        jScrollPane9.setViewportView(jtaSearch);

        jbtnSearchExecute.setText("执行");
        jbtnSearchExecute.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnSearchExecuteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 684, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtnSearchExecute)
                .addGap(98, 98, 98))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(jbtnSearchExecute)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("search", jPanel11);

        jSplitPane1.setTopComponent(jTabbedPane1);

        jtaOutput.setColumns(20);
        jtaOutput.setRows(5);
        jtaOutput.setComponentPopupMenu(jPopupMenu1);
        jScrollPane2.setViewportView(jtaOutput);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 838, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
        );

        jSplitPane1.setRightComponent(jPanel4);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbtnGetEventAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnGetEventAllActionPerformed
        stopRunningCmdTask();
        OutputReceiver receiver = new OutputReceiver();
        receiver.setCallback(new UpdateOutputTextArea());
        ExcuteGetEventImplicit excute = new ExcuteGetEventImplicit(receiver);
        cmdTask = excute;
        excute.start();
    }//GEN-LAST:event_jbtnGetEventAllActionPerformed

    private void jbtnGetEventXActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnGetEventXActionPerformed
        stopRunningCmdTask();
        GetEventCmdOutputReceiver receiver = new GetEventCmdOutputReceiver();
        receiver.setCallback(new UpdateOutputTextArea());
//        String eventNum = jTextField1.getText();
        int eventNum = Integer.valueOf(jtfEventX.getText());
//        receiver.setEventNum(Integer.valueOf(eventNum));
        receiver.setEventNum(eventNum);
        ExcuteGetEventExplicit excute = new ExcuteGetEventExplicit(receiver, eventNum);
        cmdTask = excute;
        excute.start();
    }//GEN-LAST:event_jbtnGetEventXActionPerformed

    private void jbtnStopCommandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnStopCommandActionPerformed
        if (cmdTask != null && cmdTask.isAlive()) {
            cmdTask.stop();
            cmdTask = null;
        }
    }//GEN-LAST:event_jbtnStopCommandActionPerformed

    private void jbtnFindAllInputDeviceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnFindAllInputDeviceActionPerformed
        stopRunningCmdTask();
        OutputReceiver receiver = new OutputReceiver();
        receiver.setCallback(new UpdateOutputTextArea());
        ExcuteLookForEvent excute = new ExcuteLookForEvent(receiver);
        cmdTask = excute;
        excute.start();
    }//GEN-LAST:event_jbtnFindAllInputDeviceActionPerformed

    private void jbtnTouchExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnTouchExecuteActionPerformed
//        String event = jTextField1.getText();
        String xExpress = jtfXExpress.getText();
        String yExpress = jtfYExpress.getText();
        String cmd = jtaTouch.getText();
        String x = jtfTouchX.getText();
        String y = jtfTouchY.getText();
        CommandManager.executeCommand(
                CommandManager.touchCommand(cmd, x, y, xExpress, yExpress));
//        FelEngine fel = new FelEngineImpl();
//        String xExpress = _xExpress.replaceAll("x", _x);
//        String yExpress = _yExpress.replaceAll("y", _y);
//        int x = (Integer) fel.eval(xExpress);
//        int y = (Integer) fel.eval(yExpress);
        
//        JOptionPane.showMessageDialog(null,x + "  " + y);
//        cmd = cmd.replaceAll("x", String.valueOf(x)).replaceAll("y", String.valueOf(y));
//        String[] items = cmd.split("@\n");
//        for (String item : items) {
//            IDevice device = AndroidProxy.getInstance().getDevice();
//            try {
//                device.executeShellCommand(item, new OutputReceiver());
//            } catch (IOException ex) {
//                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        }
    }//GEN-LAST:event_jbtnTouchExecuteActionPerformed

    private void jbtnDragExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnDragExecuteActionPerformed
        String startx = jtfDragStartX.getText();
        String starty = jtfDragStartY.getText();
        String endx = jtfDragEndX.getText();
        String endy = jtfDragY.getText();
        String steps = jtfDragSteps.getText();
        String xExpress = jtfXExpress.getText();
        String yExpress = jtfYExpress.getText();
        String startCMD = jtaDragStart.getText();
        String procedureCMD = jtaDragProcedure.getText();
        String endCMD = jtaDragEnd.getText();
        CommandManager.executeCommand(
                CommandManager.dragCommand(
                startCMD, procedureCMD, endCMD, 
                startx, starty, endx, endy, Integer.valueOf(steps), xExpress, yExpress));
        
        
//        String _startx = jtfDragStartX.getText();
//        String _starty = jtfDragStartY.getText();
//        String _endx = jtfDragEndX.getText();
//        String _endy = jtfDragY.getText();
//        String _step = jtfDragSteps.getText();
//        String xExpress = jtfXExpress.getText();
//        String yExpress = jtfYExpress.getText();
//        FelEngine fel = new FelEngineImpl();
//        int startx = Double.valueOf(fel.eval(xExpress.replaceAll("x", _startx)).toString()).intValue();
//        int starty = Double.valueOf(fel.eval(yExpress.replaceAll("y", _starty)).toString()).intValue();
//        int endx = Double.valueOf(fel.eval(xExpress.replaceAll("x", _endx)).toString()).intValue();
//        int endy = Double.valueOf(fel.eval(yExpress.replaceAll("y", _endy)).toString()).intValue();
//        int step = Integer.valueOf(_step);
//        int procedurex = (endx - startx) / step;
//	int procedurey = (endy - starty) / step;
//        IDevice device = AndroidProxy.getInstance().getDevice();
//        OutputReceiver or = new OutputReceiver();
//        String start = jtaDragStart.getText().replaceAll("startx", String.valueOf(startx)).replaceAll("starty", String.valueOf(starty));
//        String[] startCMDS = start.split("@\n");
//        for (String startCMD : startCMDS) {
//            try {
//                device.executeShellCommand(startCMD, or);
//            } catch (IOException ex) {
//                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        }
//        
//        for (int i = 0; i < step; i++) {
//            int x = startx + procedurex * i;
//            int y = starty + procedurey * i;
//            String procedure = jtaDragProcedure.getText().replaceAll("x", String.valueOf(x)).replaceAll("y", String.valueOf(y));
//            String[] procedureCMDS = procedure.split("@\n");
//            for (String procedureCMD : procedureCMDS) {
//                try {
//                    device.executeShellCommand(procedureCMD, or);
//                } catch (IOException ex) {
//                    Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
//                }
//            }
//            
//        }
//        
//        String end = jtaDragEnd.getText().replaceAll("endx", String.valueOf(endx)).replaceAll("endy", String.valueOf(endy));
//        String[] endCMDS = end.split("@\n");
//        for (String endCMD : endCMDS) {
//            try {
//                device.executeShellCommand(endCMD, or);
//            } catch (IOException ex) {
//                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        }
        
    }//GEN-LAST:event_jbtnDragExecuteActionPerformed

    private void jbtnHomeExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnHomeExecuteActionPerformed
        String cmd = jtaHome.getText();
        CommandManager.executeCommand(CommandManager.homeCommand(cmd));
//         String[] items = cmd.split("@\n");
//        IDevice device = AndroidProxy.getInstance().getDevice();
//        OutputReceiver or = new OutputReceiver();
//        for (String item : items) {
//            try {
//                device.executeShellCommand(item, or);
//            } catch (IOException ex) {
//                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
//            } 
//        }
    }//GEN-LAST:event_jbtnHomeExecuteActionPerformed

    private void jbtnBackExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnBackExecuteActionPerformed
        String cmd = jtaBack.getText();
        CommandManager.executeCommand(CommandManager.homeCommand(cmd));
//        String crlf = System.getProperty("line.separator");
//        String[] items = cmd.split(crlf);
//        String[] items = cmd.split("@\n");
//        IDevice device = AndroidProxy.getInstance().getDevice();
//        OutputReceiver or = new OutputReceiver();
//        for (String item : items) {
//            try {
//                device.executeShellCommand(item, or);
//            } catch (IOException ex) {
//                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
//            } 
//        }
       
    }//GEN-LAST:event_jbtnBackExecuteActionPerformed

    private void jbtnMenuExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnMenuExecuteActionPerformed
        String cmd = jtaMenu.getText();
        CommandManager.executeCommand(CommandManager.homeCommand(cmd));
//        String[] items = cmd.split("@\n");
//        IDevice device = AndroidProxy.getInstance().getDevice();
//        OutputReceiver or = new OutputReceiver();
//        for (String item : items) {
//            try {
//                device.executeShellCommand(item, or);
//            } catch (IOException ex) {
//                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
//            } 
//        }
    }//GEN-LAST:event_jbtnMenuExecuteActionPerformed

    private void jbtnSearchExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnSearchExecuteActionPerformed
         String cmd = jtaSearch.getText();
         CommandManager.executeCommand(CommandManager.homeCommand(cmd));
//         String[] items = cmd.split("@\n");
//        IDevice device = AndroidProxy.getInstance().getDevice();
//        OutputReceiver or = new OutputReceiver();
//        for (String item : items) {
//            try {
//                device.executeShellCommand(item, or);
//            } catch (IOException ex) {
//                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
//            } 
//        }
    }//GEN-LAST:event_jbtnSearchExecuteActionPerformed

    private void jbtnLongpressExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnLongpressExecuteActionPerformed

//        String startCMD = jtaLongpressStart.getText();
//        String endCMD = jtaLongpressEnd.getText();
//        String x = jtfLongpressX.getText();
//        String y = jtfLongpressY.getText();
//        String xExpress = jtfXExpress.getText();
//        String yExpress = jtfYExpress.getText();
//        CommandManager.executeCommand(
//                CommandManager.LongpressCommand(startCMD, endCMD, x, y, xExpress, yExpress));
    	String start = jtaLongpressStart.getText();
    	String end = jtaLongpressEnd.getText();
    	String _x = jtfLongpressX.getText();
    	String _y = jtfLongpressY.getText();
      String xExpress = jtfXExpress.getText().replaceFirst("x", _x);
      String yExpress = jtfYExpress.getText().replaceFirst("y", _y);
      FelEngine fel = new FelEngineImpl();
      String finalx = fel.eval(xExpress).toString();
      String finaly = fel.eval(yExpress).toString();
        String startCMD = start.replaceAll("startx", finalx).replaceAll("starty", finaly);
        String endCMD = end.replaceAll("endx", finalx).replaceAll("endy", finaly);
        System.out.println(startCMD);
        System.out.println(endCMD);
        IDevice device = AndroidProxy.getInstance().getDevice();
        OutputReceiver or = new OutputReceiver();
        long startTime = System.currentTimeMillis();
        while (true) {
            try {
                System.out.println(startCMD);
                device.executeShellCommand(startCMD + "\r\n", or);
            } catch (IOException ex) {
                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
            } catch (TimeoutException e) {
				e.printStackTrace();
			} catch (AdbCommandRejectedException e) {
				e.printStackTrace();
			} catch (ShellCommandUnresponsiveException e) {
				e.printStackTrace();
			}
            long endTime = System.currentTimeMillis();
            if (endTime - startTime >= 4000) {
                break;
            }
        }
        try {
                System.out.println(startCMD);
                device.executeShellCommand(startCMD, or);
                Thread.sleep(1500);
            } catch (InterruptedException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
            } catch (TimeoutException e) {
			e.printStackTrace();
		} catch (AdbCommandRejectedException e) {
			e.printStackTrace();
		} catch (ShellCommandUnresponsiveException e) {
			e.printStackTrace();
		}
        try {
            System.out.println(endCMD);
            device.executeShellCommand(endCMD, or);
        } catch (IOException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (TimeoutException e) {
			e.printStackTrace();
		} catch (AdbCommandRejectedException e) {
			e.printStackTrace();
		} catch (ShellCommandUnresponsiveException e) {
			e.printStackTrace();
		}

        /*
        OutputReceiver or = new OutputReceiver();
        IDevice device = AndroidProxy.getInstance().getDevice();
        String[] commands1 = {
				"sendevent dev/input/event3 3 48 25",
				"sendevent dev/input/event3 3 50 2",
				"sendevent dev/input/event3 3 53 " + "868",
				"sendevent dev/input/event3 3 54 " + "697",
				"sendevent dev/input/event3 0 2 0",
				"sendevent dev/input/event3 0 0 0",
		};
		StringBuilder sb1 = new StringBuilder();
		for (String cmd : commands1) {
			sb1.append(cmd);
			sb1.append("\r\n");
		}
		long start = System.currentTimeMillis();
		long end = 0;
		while (true) {
            try {
                device.executeShellCommand(sb1.toString(), or);
            } catch (IOException ex) {
                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
			end = System.currentTimeMillis();
			if (end - start >= 3000) {
				break;
			}
		}
		
		String[] commands2 = {
				"sendevent dev/input/event3 3 48 0",
				"sendevent dev/input/event3 3 50 2",
				"sendevent dev/input/event3 3 53 " + "868",
				"sendevent dev/input/event3 3 54 " + "697",
				"sendevent dev/input/event3 0 2 0",
				"sendevent dev/input/event3 0 0 0",
		};
		StringBuilder sb2 = new StringBuilder();
		for (String cmd : commands2) {
			sb2.append(cmd);
			sb2.append("\r\n");
		}
        try {
            device.executeShellCommand(sb2.toString(), or);
        } catch (IOException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
        */
    }//GEN-LAST:event_jbtnLongpressExecuteActionPerformed

    private void jbtnExportConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnExportConfigActionPerformed
        String crlf = System.getProperty("line.separator");
        
        String xExpress = jtfXExpress.getText();
        String yExpress = jtfYExpress.getText();
        
        String touchCMD = jtaTouch.getText().replaceAll("\n", crlf) + crlf;
        
        String dragStartCMD = jtaDragStart.getText().replaceAll("\n", crlf) + crlf;
        String dragProceudreCMD= jtaDragProcedure.getText().replaceAll("\n", crlf) + crlf;
        String dragEndCMD = jtaDragEnd.getText().replaceAll("\n", crlf) + crlf;
        
        String longpressStartCMD = jtaLongpressStart.getText().replaceAll("\n", crlf) + crlf;
        String longpressEndCMD = jtaLongpressEnd.getText().replaceAll("\n", crlf) + crlf;
        
        String homeCMD = jtaHome.getText().replaceAll("\n", crlf) + crlf;
        
        String backCMD = jtaBack.getText().replaceAll("\n", crlf) + crlf;
        
        String menuCMD = jtaMenu.getText().replaceAll("\n", crlf) + crlf;
        
        String searchCMD = jtaSearch.getText().replaceAll("\n", crlf) + crlf;
        
        String sn = AndroidProxy.getInstance().getDevice().getSerialNumber();
        
         
        
//        StringBuilder sb = new StringBuilder();
//        sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
//        
//        sb.append("<device sn=\""+ sn +"\">");
//        sb.append("<express>");
//         sb.append("</express>");
//        sb.append("</device>");
        
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder;
        try {
            builder = factory.newDocumentBuilder();
            Document doc = builder.newDocument();
            Element device = doc.createElement("device");
            device.setAttribute("sn", sn);
            
            Element express = doc.createElement("express");
            Element x = doc.createElement("x");
            x.setTextContent(xExpress);
            Element y = doc.createElement("y");
            y.setTextContent(yExpress);
            express.appendChild(x);
            express.appendChild(y);
            Element touch = doc.createElement("touch");
            touch.setTextContent(touchCMD);
            Element drag = doc.createElement("drag");
            Element dragStart = doc.createElement("drag_start");
            dragStart.setTextContent(dragStartCMD);
            Element dragProcedure = doc.createElement("drag_procedure");
            dragProcedure.setTextContent(dragProceudreCMD);
            Element dragEnd = doc.createElement("drag_end");
            dragEnd.setTextContent(dragEndCMD);
            drag.appendChild(dragStart);
            drag.appendChild(dragProcedure);
            drag.appendChild(dragEnd);
            Element longpress = doc.createElement("longpress");
            Element longpressStart = doc.createElement("longpress_start");
            longpressStart.setTextContent(longpressStartCMD);
            Element longpressEnd = doc.createElement("longpress_end");
            longpressEnd.setTextContent(longpressEndCMD);
            longpress.appendChild(longpressStart);
            longpress.appendChild(longpressEnd);
            Element home = doc.createElement("home");
            home.setTextContent(homeCMD);
            Element back = doc.createElement("back");
            back.setTextContent(backCMD);
            Element menu = doc.createElement("menu");
            menu.setTextContent(menuCMD);
            Element search = doc.createElement("search");
            search.setTextContent(searchCMD);
            device.appendChild(express);
            device.appendChild(touch);
            device.appendChild(drag);
            device.appendChild(longpress);
            device.appendChild(home);
            device.appendChild(back);
            device.appendChild(menu);
            device.appendChild(search);
            doc.appendChild(device);
            
            JFileChooser chooser = new JFileChooser();
           chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
           chooser.setFileFilter(new FileNameExtensionFilter( "xml",new String[]{"xml"}));
            File file = new File(sn + ".xml");
            chooser.setSelectedFile(file);
            int retval = chooser.showSaveDialog(this);//显示“保存文件”对话框
            if(retval == JFileChooser.APPROVE_OPTION) {
                file = chooser.getSelectedFile();
//                System.out.println("File to save " + file);
                try{
                TransformerFactory tFactory = TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                DOMSource source = new DOMSource(doc);
                StreamResult result = new StreamResult(file);
                transformer.transform(source, result);
                }catch (TransformerException ex) {
                    Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
                } 
            }
            } catch (ParserConfigurationException ex) {
                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
            }

    }//GEN-LAST:event_jbtnExportConfigActionPerformed

    private void clearTextActionPerformed(java.awt.event.ActionEvent evt) {
        jtaOutput.setText("");
    }
    
    private void copyText(java.awt.event.ActionEvent evt) {
        jtaOutput.copy();
    }
    
    class UpdateOutputTextArea implements ReceiverCallback{

        @Override
        public void doPerform(final String result) {
            EventQueue.invokeLater(new Runnable() {

                @Override
                public void run() {
//                    String text = jTextArea2.getText();
                    jtaOutput.append(result);
//                    if (text.length() >= 10000) {
//                        jTextArea2.setText("");
//                    } else {
//                        jTextArea2.append(result);
//                    }
                }
            });
            
        }
        
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    //back 命令执行
    private javax.swing.JButton jbtnBackExecute;
    //drag命令执行按钮
    private javax.swing.JButton jbtnDragExecute;
    private javax.swing.JButton jbtnExportConfig;
    //执行cat /pro/bus/input/devices命令按钮
    public javax.swing.JButton jbtnFindAllInputDevice;
    //执行getevent命令按钮
    public javax.swing.JButton jbtnGetEventAll;
    //getevent /dev/input/eventX 命令执行按钮
    public javax.swing.JButton jbtnGetEventX;
    //home执行命令
    private javax.swing.JButton jbtnHomeExecute;
    //longpress 长按命令执行
    private javax.swing.JButton jbtnLongpressExecute;
    //menu 命令执行按钮
    private javax.swing.JButton jbtnMenuExecute;
    //search 搜索命令执行按钮
    private javax.swing.JButton jbtnSearchExecute;
    //停止执行所有命令
    private javax.swing.JButton jbtnStopCommand;
    //touch命令 执行按钮
    private javax.swing.JButton jbtnTouchExecute;
    //back命令
    private javax.swing.JTextArea jtaBack;
    //drag命令 结束部分
    private javax.swing.JTextArea jtaDragEnd;
    //drag命令 执行过程部分
    private javax.swing.JTextArea jtaDragProcedure;
    //darg命令 起始部分
    private javax.swing.JTextArea jtaDragStart;
    //home命令
    private javax.swing.JTextArea jtaHome;
    //Longpress 长按结束
    private javax.swing.JTextArea jtaLongpressEnd;
    //longpress 长按起始
    private javax.swing.JTextArea jtaLongpressStart;
    //menu 菜单命令内容
    private javax.swing.JTextArea jtaMenu;
    //命令输出
    public javax.swing.JTextArea jtaOutput;
    //search 命令内容
    private javax.swing.JTextArea jtaSearch;
    //touch命令 内容
    private javax.swing.JTextArea jtaTouch;
    //drag 拖动过程X坐标
    private javax.swing.JTextField jtfDragEndX;
    //drag 起始X坐标
    private javax.swing.JTextField jtfDragStartX;
    //darg 起始Y坐标
    private javax.swing.JTextField jtfDragStartY;
    //drag 执行步数
    private javax.swing.JTextField jtfDragSteps;
    //drag 拖动过程Y坐标
    private javax.swing.JTextField jtfDragY;
    //getevent /dev/input/eventX X参数，捕捉事件
    private javax.swing.JTextField jtfEventX;
    //longpress 长按X
    private javax.swing.JTextField jtfLongpressX;
    //Longpress 长按Y
    private javax.swing.JTextField jtfLongpressY;
    //touch命令 X坐标
    private javax.swing.JTextField jtfTouchX;
    //touch命令 y坐标
    private javax.swing.JTextField jtfTouchY;
    //计算x坐标表达式
    private javax.swing.JTextField jtfXExpress;
    //计算Y坐标表达式
    private javax.swing.JTextField jtfYExpress;
    // End of variables declaration//GEN-END:variables
}
